ICE plot for projection pursuit regression with compositional predictor variables.
ice.pprcomp(y, x, nterms = 3, k = 1, type = "alr")
A numerical vector with the continuous variable.
A matrix with the compositional data. No zero values are allowed.
The number of terms to include in the final model.
Which variable to select?.
Either "alr" or "log" corresponding to the additive log-ratio transformation or the simple logarithm applied to the compositional data.
A graph with several curves. The horizontal axis contains the selected variable, whereas the vertical axis contains the centered predicted values. The black curves are the effects for each observation and whe blue line is their average effect. The turquoise line is the smmothed curve produced by the loess function of the average effect and the selected variable.
This function implements the Individual Conditional Expecation plots of Goldstein et al. (2015). See the references for more details.
https://christophm.github.io/interpretable-ml-book/ice.html
Goldstein, A., Kapelner, A., Bleich, J. and Pitkin, E. (2015). Peeking inside the black box: Visualizing statistical learning with plots of individual conditional expectation. Journal of Computational and Graphical Statistics 24(1): 44-65.
Friedman, J. H. and Stuetzle, W. (1981). Projection pursuit regression. Journal of the American Statistical Association, 76, 817-823. doi: 10.2307/2287576.
# NOT RUN {
x <- as.matrix( iris[1:50, 2:4] )
x <- x/ rowSums(x)
y <- iris[1:50, 1]
pprcomp(y, x)
ice.pprcomp(y, x)
# }
Run the code above in your browser using DataLab